<html>
<head><meta charset="utf-8"><title>Adding ids to elements · t-compiler/wg-rustc-dev-guide · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/index.html">t-compiler/wg-rustc-dev-guide</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html">Adding ids to elements</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="192828230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192828230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192828230">(Apr 03 2020 at 16:18)</a>:</h4>
<p>Is it possible with mdbook to add an id to any element? Specifically, I'm wondering if it's possible to add an id to a table cell to be able to directly link to items in the glossary. This is related to this ticket: <a href="https://github.com/rust-lang/rustc-dev-guide/issues/418" title="https://github.com/rust-lang/rustc-dev-guide/issues/418">https://github.com/rust-lang/rustc-dev-guide/issues/418</a></p>



<a name="192863945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192863945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192863945">(Apr 03 2020 at 21:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116114">@Paul Faria</span> That's a great question! I have often wanted to do that</p>



<a name="192864031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192864031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192864031">(Apr 03 2020 at 21:06)</a>:</h4>
<p>In general, I use <code>&lt;a name="foo"&gt;&lt;/a&gt;</code> and link to <code>./blah.md#foo</code>, but I'm not sure if this works inside tables</p>



<a name="192864044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192864044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192864044">(Apr 03 2020 at 21:06)</a>:</h4>
<p>I guess there is no reason why it shouldn't work?</p>



<a name="192865994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192865994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192865994">(Apr 03 2020 at 21:26)</a>:</h4>
<p>In tables I figured it out. I have a <code>&lt;div I'd="some-id"/&gt;</code> <em>after</em> the item. Using links or IDs before breaks the table.</p>



<a name="192866079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192866079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192866079">(Apr 03 2020 at 21:27)</a>:</h4>
<p>The others cause the table to stop formatting. Only happens with mdbook, the markdown renderer I have in VS Code doesn't have as many restrictions.</p>



<a name="192866168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192866168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192866168">(Apr 03 2020 at 21:28)</a>:</h4>
<p>That's good to know</p>



<a name="192866237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192866237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192866237">(Apr 03 2020 at 21:29)</a>:</h4>
<p>There are a bunch of links throughout the guide to various terms in the glossary, and making those point to specific items would be awesome</p>



<a name="192866349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192866349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192866349">(Apr 03 2020 at 21:30)</a>:</h4>
<p>That's what I'm working on actually <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span></p>



<a name="192866862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192866862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192866862">(Apr 03 2020 at 21:35)</a>:</h4>
<p>The only downside seems to be that the linked item shows under the banner so you have to scroll up a little to see it</p>



<a name="192868132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192868132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192868132">(Apr 03 2020 at 21:50)</a>:</h4>
<p>Just discovered that there's two definitions for "trait reference" <a href="/user_uploads/4715/4T0Rm5urxNJ93IXYLdRseXWQ/Screenshot-from-2020-04-03-17-49-42.png" title="Screenshot-from-2020-04-03-17-49-42.png">Screenshot-from-2020-04-03-17-49-42.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/4T0Rm5urxNJ93IXYLdRseXWQ/Screenshot-from-2020-04-03-17-49-42.png" title="Screenshot-from-2020-04-03-17-49-42.png"><img src="/user_uploads/4715/4T0Rm5urxNJ93IXYLdRseXWQ/Screenshot-from-2020-04-03-17-49-42.png"></a></div>



<a name="192868209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192868209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192868209">(Apr 03 2020 at 21:51)</a>:</h4>
<p>Is that correct? Each one links to a different doc. The first to <code>../traits/goals-and-clauses.html#trait-ref</code> and the second to <code>../ty.html</code>. Should the titles be disambiguated somehow?</p>



<a name="192869634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192869634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192869634">(Apr 03 2020 at 22:06)</a>:</h4>
<p><span class="user-mention" data-user-id="198054">@mark-i-m</span> and done: <a href="https://github.com/rust-lang/rustc-dev-guide/pull/662" title="https://github.com/rust-lang/rustc-dev-guide/pull/662">https://github.com/rust-lang/rustc-dev-guide/pull/662</a></p>



<a name="192986451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192986451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192986451">(Apr 06 2020 at 00:59)</a>:</h4>
<blockquote>
<p>Just discovered that there's two definitions for "trait reference" </p>
</blockquote>
<p><span class="user-mention" data-user-id="116114">@Paul Faria</span> Ah, good catch! The entries are supposed to be in alpha order, but I guess we mis-sorted and accidentally added a duplicate definition</p>



<a name="192986497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/192986497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#192986497">(Apr 06 2020 at 01:00)</a>:</h4>
<p>The first definition looks more specific to me, we can get rid of the second</p>



<a name="193044110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding%20ids%20to%20elements/near/193044110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/Adding.20ids.20to.20elements.html#193044110">(Apr 06 2020 at 13:51)</a>:</h4>
<p>Ok, PR for that up here: <a href="https://github.com/rust-lang/rustc-dev-guide/pull/670" title="https://github.com/rust-lang/rustc-dev-guide/pull/670">https://github.com/rust-lang/rustc-dev-guide/pull/670</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>